import './style/index.scss'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'default-passive-events'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' // 导入插件
// 指令
import directive from './directives/directive'

import App from './App.vue'
import router from './router'
import PowerfulTable from 'el-plus-powerful-table'
import PowerfulForm from 'el-plus-powerful-form'
const app = createApp(App)

app.use(router)
app.use(createPinia().use(piniaPluginPersistedstate))
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(PowerfulTable, {
  listRequest: {
    pageSizeKey: 'pageSize',
    pageNoKey: 'pageIndex',
    responseKey: 'data.data',
    listsKey: 'rows',
    totalKey: 'total',
  },
})
app.use(PowerfulForm)
app.use(router)
app.mount('#app')

directive(app)
